﻿<UserControl x:Class="Gao.Poker.App.UserControls.SalesRecord"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition Height="30"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="200"/>
        </Grid.ColumnDefinitions>
        <ListView Grid.ColumnSpan="2"  Margin="1" SelectionMode="Single" IsSynchronizedWithCurrentItem="True"
                 ItemsSource="{Binding Path=ConsumptionProducts}">
            <ListView.ItemContainerStyle>
                <Style TargetType="ListViewItem">
                    <Setter Property="HorizontalContentAlignment" Value="Center" />
                </Style>
            </ListView.ItemContainerStyle>
            <ListView.View>
                <GridView>
                    <GridViewColumn Header="编码"  Width="60" DisplayMemberBinding="{Binding Path=BarCode}"/>
                    <GridViewColumn Header="商品名称" Width="auto" DisplayMemberBinding="{Binding Path=ProductName}"/>
                    <GridViewColumn Header="单价" Width="80" DisplayMemberBinding="{Binding Path=Price}" TextBlock.TextAlignment="Right"/>
                    <GridViewColumn Header="购买数量" Width="90" DisplayMemberBinding="{Binding Path=Number}" TextBlock.TextAlignment="Right"/>
                    <GridViewColumn Header="折扣" Width="90" DisplayMemberBinding="{Binding Path=Discount}" TextBlock.TextAlignment="Right"/>
                    <GridViewColumn Header="总计" Width="100" DisplayMemberBinding="{Binding Path=Total}" TextBlock.TextAlignment="Right"/>
                </GridView>
            </ListView.View>
        </ListView>
        <StackPanel Grid.Row="1" HorizontalAlignment="Right" VerticalAlignment="Center" Orientation="Horizontal">
            <TextBlock Text="总计:"/>
            <TextBlock Text="{Binding Path=Monetary}"/>
        </StackPanel>
        <StackPanel Margin="20,0,0,0" Grid.Row="1" Grid.Column="1" HorizontalAlignment="Right" VerticalAlignment="Center" Orientation="Horizontal">
            <TextBlock Text="日期:"/>
            <TextBlock Text="{Binding Path=CreateDt,StringFormat='yyyy-MM-dd hh:mm:ss'}"/>
        </StackPanel>
    </Grid>
</UserControl>
